import http from './request';



//登录请求
export const adminLogin = (params: ILoginParams): RES<IloginModel> => http.post('/admin/login', params);

//获取用户信息
export const adminInfo = (): RES<DatainfoModel> => http.get('/admin/info');

export const adminList = (params: IAdminListParams): RES<adminListModel> => http.get('/admin/list', { params });

//修改账号状态 
export const UpdateStatus = (id: number, status: number): RES<number> => http.post(`/admin/updateStatus/${id}?status=${status}`)


// 添加用户列表
export const adminRegister = (params: ListModel): RES<ListModel> => http.post('/admin/register', params);


// 根据id请求用户信息
export const getAdminInfoById = (id: number): RES<ListModel> => http.get(`/admin/${id}`);

// 根据id修改指定用户信息
export const updateAdminInfoById = (params: ListModel): RES<number> => http.post(`/admin/update/${params.id}`, params);